Here, we’re just setting a few options.
knitr::opts_chunk$set(
warning = FALSE, # show warnings during codebook generation
message = FALSE, # show messages during codebook generation
error = TRUE, # do not interrupt codebook generation in case of errors,
# usually better for debugging
echo = TRUE # show R code
)
ggplot2::theme_set(ggplot2::theme_bw())
Now, we’re preparing our data for the codebook.
library(codebook)
library(formr)
# library(labelled)
# library(ufs)
# library(GGally)
############################################################################## #
### THESE ARE THE ONLY TWO LINES OF CODE THAT I NEED TO ENTER ########## #
############################################################################## #
# formr_store_keys("juergen") # save my login credentials (do just once)
formr_connect(keyring = "juergen") # retreive credentials and login to formr
codebook_data <- formr_results("codebook_workshop") # pulls survey results
# also aggregates items with
# the same name and continuous
# numbers at the end
# to import an SPSS file from the same folder uncomment and edit the line below
# codebook_data <- rio::import("mydata.sav")
# for Stata
# codebook_data <- rio::import("mydata.dta")
# for CSV
# codebook_data <- rio::import("mydata.csv")
# omit the following lines, if your missing values are already properly labelled
codebook_data <- detect_missing(codebook_data,
only_labelled = TRUE, # only labelled values are autodetected as
# missing
negative_values_are_missing = FALSE, # negative values are missing values
ninety_nine_problems = TRUE, # 99/999 are missing values, if they
# are more than 5 MAD from the median
)
# If you are not using formr, the codebook package needs to guess which items
# form a scale. The following line finds item aggregates with names like this:
# scale = scale_1 + scale_2R + scale_3R
# identifying these aggregates allows the codebook function to
# automatically compute reliabilities.
# However, it will not reverse items automatically.
codebook_data <- detect_scales(codebook_data)
Create codebook
codebook(codebook_data)
Dataset name: codebook_data
The dataset has N=41 rows and 14 columns. 0 rows have no missing values on any column.
|
39 completed rows, 39 who entered any information, 2 only viewed the first page. There are 0 expired rows (people who did not finish filling out in the requested time frame). In total, there are 41 rows including unfinished and expired rows.
There were 41 unique participants, of which 39 finished filling out at least one survey.
This survey was not repeated.
The first session started on 2023-02-13 10:36:26, the last session on 2023-02-13 10:59:53.
Starting date times
People took on average 0.76 minutes (median 0.67) to answer the survey.
Duration people took for answering the survey
Hatten Sie schon die Gelegenheit das codebook package auszuprobieren?
Distribution of values for cbk
2 missing values.
| name | label | type | data_type | optional | showif | value | item_order | block_order | class | n_missing | complete_rate | min | median | max | mean | sd | n_value_labels | hist |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| cbk | Hatten Sie schon die Gelegenheit das codebook package auszuprobieren? | mc_button | haven_labelled | 0 | 5 | 2 | 0.9512195 | 1 | 1 | 2 | 1.128205 | 0.3386884 | 4 | ▇▁▁▁▁▁▁▁ |
| type | name | label | optional | class | showif | value | block_order | item_order |
|---|---|---|---|---|---|---|---|---|
| mc_button | cbk | Hatten Sie schon die Gelegenheit das codebook package auszuprobieren? | 0 | 5 |
| name | value |
|---|---|
| nein | 1 |
| kurz reingeschaut | 2 |
| ja | 3 |
| Item was never rendered for this user. | NA |
Reliability: ωtotal [95% CI] = 0.82 [not computed].
Missing: 2.
Likert plot of scale sof items
Distribution of scale sof
| Dataframe: | res$dat |
| Items: | sof_1, sof_2 & sof_3 |
| Observations: | 39 |
| Positive correlations: | 3 |
| Number of correlations: | 3 |
| Percentage positive correlations: | 100 |
| Omega (total): | 0.82 |
| Omega (hierarchical): | 0.41 |
| Revelle’s Omega (total): | 0.87 |
| Greatest Lower Bound (GLB): | 0.90 |
| Coefficient H: | 1.00 |
| Coefficient Alpha: | 0.78 |
| Ordinal Omega (total): | NA |
| Ordinal Omega (hierarch.): | NA |
| Ordinal Coefficient Alpha: | 0.91 |
Note: the normal point estimate and confidence interval for omega are based on the procedure suggested by Dunn, Baguley & Brunsden (2013) using the MBESS function ci.reliability, whereas the psych package point estimate was suggested in Revelle & Zinbarg (2008). See the help (‘?ufs::scaleStructure’) for more information.
2.202, 0.79 & 0.008
| PC1 | |
|---|---|
| sof_1 | 0.966 |
| sof_2 | 0.970 |
| sof_3 | 0.572 |
| mean | median | var | sd | IQR | se | min | q1 | q3 | max | skew | kurt | dip | n | NA | valid | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sof_1 | 5.5385 | 6 | 1.6235 | 1.2742 | 0 | 0.204 | 1 | 3 | NA | 6 | -2.9064 | 7.6605 | 0.0256 | 39 | 0 | 39 |
| sof_2 | 5.5128 | 6 | 1.6248 | 1.2747 | 0 | 0.2041 | 1 | 3 | NA | 6 | -2.8426 | 7.3858 | 0.0385 | 39 | 0 | 39 |
| sof_3 | 5.1538 | 6 | 2.3441 | 1.5311 | 1 | 0.2452 | 1 | 3.5 | NA | 6 | -1.8028 | 2.2269 | 0.0385 | 39 | 0 | 39 |
Scatterplot
| name | label | type | type_options | data_type | value_labels | optional | showif | value | item_order | block_order | class | n_missing | complete_rate | min | median | max | mean | sd | n_value_labels | hist |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sof_1 | Haben Sie eine aktuelle R-Version installiert? | rating_button | 1,6,1 | haven_labelled | 1. 1: hat nicht geklappt, 2. 2, 3. 3, 4. 4, 5. 5, 6. 6: hat problemlos geklappt, NA. Item was never rendered for this user. |
0 | 2 | 2 | 0.9512195 | 1 | 6 | 6 | 5.538462 | 1.274159 | 7 | ▁▁▁▁▁▁▁▇ | ||||
| sof_2 | Haben Sie eine aktuelle RStudio-Version installiert? | rating_button | 1,6,1 | haven_labelled | 1. 1: hat nicht geklappt, 2. 2, 3. 3, 4. 4, 5. 5, 6. 6: hat problemlos geklappt, NA. Item was never rendered for this user. |
0 | 3 | 2 | 0.9512195 | 1 | 6 | 6 | 5.512821 | 1.274689 | 7 | ▁▁▁▁▁▁▁▇ | ||||
| sof_3 | Haben Sie das codebook package installiert? | rating_button | 1,6,1 | haven_labelled | 1. 1: hat nicht geklappt, 2. 2, 3. 3, 4. 4, 5. 5, 6. 6: hat problemlos geklappt, NA. Item was never rendered for this user. |
0 | 4 | 2 | 0.9512195 | 1 | 6 | 6 | 5.153846 | 1.531055 | 7 | ▁▁▁▁▁▁▁▇ |
Reliability: ωordinal [95% CI] = 0.87 [0.79;0.94].
Missing: 2.
Likert plot of scale rmd items
Distribution of scale rmd
| Dataframe: | res$dat |
| Items: | rmd_01, rmd_02 & rmd_03 |
| Observations: | 39 |
| Positive correlations: | 3 |
| Number of correlations: | 3 |
| Percentage positive correlations: | 100 |
| Omega (total): | 0.84 |
| Omega (hierarchical): | 0.02 |
| Revelle’s Omega (total): | 0.84 |
| Greatest Lower Bound (GLB): | 0.84 |
| Coefficient H: | 0.84 |
| Coefficient Alpha: | 0.84 |
Confidence intervals
| Omega (total): | [0.76; 0.93] |
| Coefficient Alpha: | [0.75; 0.93] |
| Ordinal Omega (total): | 0.87 |
| Ordinal Omega (hierarch.): | 0.84 |
| Ordinal Coefficient Alpha: | 0.87 |
Confidence intervals
| Ordinal Omega (total): | [0.79; 0.94] |
| Ordinal Coefficient Alpha: | [0.79; 0.94] |
Note: the normal point estimate and confidence interval for omega are based on the procedure suggested by Dunn, Baguley & Brunsden (2013) using the MBESS function ci.reliability, whereas the psych package point estimate was suggested in Revelle & Zinbarg (2008). See the help (‘?ufs::scaleStructure’) for more information.
2.28, 0.378 & 0.342
| PC1 | |
|---|---|
| rmd_01 | 0.865 |
| rmd_02 | 0.871 |
| rmd_03 | 0.879 |
| mean | median | var | sd | IQR | se | min | q1 | q3 | max | skew | kurt | dip | n | NA | valid | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| rmd_01 | 3.2564 | 4 | 2.5641 | 1.6013 | 2 | 0.2564 | 1 | 2 | 5 | 6 | -0.0379 | -1.1374 | 0.1026 | 39 | 0 | 39 |
| rmd_02 | 3.4103 | 4 | 2.4062 | 1.5512 | 3 | 0.2484 | 1 | 2 | 5 | 6 | 0.0206 | -1.0165 | 0.1026 | 39 | 0 | 39 |
| rmd_03 | 4.1282 | 4 | 3.3779 | 1.8379 | 3 | 0.2943 | 1 | 2 | 6 | 6 | -0.5203 | -1.0912 | 0.0812 | 39 | 0 | 39 |
Scatterplot
| name | label | type | type_options | data_type | value_labels | optional | showif | value | item_order | block_order | class | n_missing | complete_rate | min | median | max | mean | sd | n_value_labels | hist |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| rmd_01 | Wie oft haben Sie schon mit R Markdown gearbeitet? | rating_button | 1,6,1 | haven_labelled | 1. 1: noch nie, 2. 2, 3. 3, 4. 4, 5. 5, 6. 6: sehr oft, NA. Item was never rendered for this user. |
0 | 6 | 2 | 0.9512195 | 1 | 4 | 6 | 3.256410 | 1.601282 | 7 | ▆▅▁▃▇▁▅▂ | ||||
| rmd_02 | Ich weiß, wie ich in R Markdown Textformatierungen vornehmen kann. | rating_button | 1,6,1 | haven_labelled | 1. 1: gar nicht, 2. 2, 3. 3, 4. 4, 5. 5, 6. 6: vollständig, NA. Item was never rendered for this user. |
0 | 7 | 2 | 0.9512195 | 1 | 4 | 6 | 3.410256 | 1.551196 | 7 | ▃▆▁▅▇▁▅▃ | ||||
| rmd_03 | Ich weiß, wie ich in R Markdown ein HTML Dokument erstelle, in dem der Analysecode und die Ergebnisse meiner statistischen Auswertungen enthalten sind. | rating_button | 1,6,1 | haven_labelled | 1. 1: hell no, 2. 2, 3. 3, 4. 4, 5. 5, 6. 6: hell yes, NA. Item was never rendered for this user. |
0 | 8 | 2 | 0.9512195 | 1 | 4 | 6 | 4.128205 | 1.837898 | 7 | ▃▁▁▃▃▁▃▇ |
The following JSON-LD can be found by search engines, if you share this codebook publicly on the web.
{
"name": "codebook_data",
"datePublished": "2023-02-13",
"description": "The dataset has N=41 rows and 14 columns.\n0 rows have no missing values on any column.\n\n\n## Table of variables\nThis table contains variable names, labels, and number of missing values.\nSee the complete codebook for more.\n\n|name |label | n_missing|\n|:--------|:-------------------------------------------------------------------------------------------------------------------------------------------------------|---------:|\n|session |NA | 0|\n|created |user first opened survey | 0|\n|modified |user last edited survey | 2|\n|ended |user finished survey | 2|\n|expired |NA | 41|\n|sof_1 |Haben Sie eine aktuelle R-Version installiert? | 2|\n|sof_2 |Haben Sie eine aktuelle RStudio-Version installiert? | 2|\n|sof_3 |Haben Sie das codebook package installiert? | 2|\n|cbk |Hatten Sie schon die Gelegenheit das codebook package auszuprobieren? | 2|\n|rmd_01 |Wie oft haben Sie schon mit R Markdown gearbeitet? | 2|\n|rmd_02 |Ich weiß, wie ich in R Markdown Textformatierungen vornehmen kann. | 2|\n|rmd_03 |Ich weiß, wie ich in R Markdown ein HTML Dokument erstelle, in dem der Analysecode und die Ergebnisse meiner statistischen Auswertungen enthalten sind. | 2|\n|sof |aggregate of 3 sof items | 2|\n|rmd |aggregate of 3 rmd items | 2|\n\n### Note\nThis dataset was automatically described using the [codebook R package](https://rubenarslan.github.io/codebook/) (version 0.9.4.9000).",
"keywords": ["session", "created", "modified", "ended", "expired", "sof_1", "sof_2", "sof_3", "cbk", "rmd_01", "rmd_02", "rmd_03", "sof", "rmd"],
"@context": "http://schema.org/",
"@type": "Dataset",
"variableMeasured": [
{
"name": "session",
"@type": "propertyValue"
},
{
"name": "created",
"description": "user first opened survey",
"@type": "propertyValue"
},
{
"name": "modified",
"description": "user last edited survey",
"@type": "propertyValue"
},
{
"name": "ended",
"description": "user finished survey",
"@type": "propertyValue"
},
{
"name": "expired",
"@type": "propertyValue"
},
{
"name": "sof_1",
"description": "Haben Sie eine aktuelle R-Version installiert?",
"value": "1. 1: hat nicht geklappt,\n2. 2,\n3. 3,\n4. 4,\n5. 5,\n6. 6: hat problemlos geklappt,\nNA. Item was never rendered for this user.",
"maxValue": 6,
"minValue": 1,
"measurementTechnique": "self-report",
"@type": "propertyValue"
},
{
"name": "sof_2",
"description": "Haben Sie eine aktuelle RStudio-Version installiert?",
"value": "1. 1: hat nicht geklappt,\n2. 2,\n3. 3,\n4. 4,\n5. 5,\n6. 6: hat problemlos geklappt,\nNA. Item was never rendered for this user.",
"maxValue": 6,
"minValue": 1,
"measurementTechnique": "self-report",
"@type": "propertyValue"
},
{
"name": "sof_3",
"description": "Haben Sie das codebook package installiert?",
"value": "1. 1: hat nicht geklappt,\n2. 2,\n3. 3,\n4. 4,\n5. 5,\n6. 6: hat problemlos geklappt,\nNA. Item was never rendered for this user.",
"maxValue": 6,
"minValue": 1,
"measurementTechnique": "self-report",
"@type": "propertyValue"
},
{
"name": "cbk",
"description": "Hatten Sie schon die Gelegenheit das codebook package auszuprobieren?",
"value": "1. nein,\n2. kurz reingeschaut,\n3. ja,\nNA. Item was never rendered for this user.",
"maxValue": 3,
"minValue": 1,
"measurementTechnique": "self-report",
"@type": "propertyValue"
},
{
"name": "rmd_01",
"description": "Wie oft haben Sie schon mit R Markdown gearbeitet?",
"value": "1. 1: noch nie,\n2. 2,\n3. 3,\n4. 4,\n5. 5,\n6. 6: sehr oft,\nNA. Item was never rendered for this user.",
"maxValue": 6,
"minValue": 1,
"measurementTechnique": "self-report",
"@type": "propertyValue"
},
{
"name": "rmd_02",
"description": "Ich weiß, wie ich in R Markdown Textformatierungen vornehmen kann.",
"value": "1. 1: gar nicht,\n2. 2,\n3. 3,\n4. 4,\n5. 5,\n6. 6: vollständig,\nNA. Item was never rendered for this user.",
"maxValue": 6,
"minValue": 1,
"measurementTechnique": "self-report",
"@type": "propertyValue"
},
{
"name": "rmd_03",
"description": "Ich weiß, wie ich in R Markdown ein HTML Dokument erstelle, in dem der Analysecode und die Ergebnisse meiner statistischen Auswertungen enthalten sind.",
"value": "1. 1: hell no,\n2. 2,\n3. 3,\n4. 4,\n5. 5,\n6. 6: hell yes,\nNA. Item was never rendered for this user.",
"maxValue": 6,
"minValue": 1,
"measurementTechnique": "self-report",
"@type": "propertyValue"
},
{
"name": "sof",
"description": "aggregate of 3 sof items",
"@type": "propertyValue"
},
{
"name": "rmd",
"description": "aggregate of 3 rmd items",
"@type": "propertyValue"
}
]
}`